/*
 * @Descripttion: 
 * @version: 
 * @Author: wishchan
 * @Date: 2021-12-20 14:20:02
 * @LastEditors: 川杨
 * @LastEditTime: 2021-12-30 14:01:10
 */
import http from '@src/util/http';
const SSB = '/api/ssbreport/outside'
import { objectDateToTimestamp } from 'pub-bbx-utils'

/**
 * 产品类型列表
 * 
 */
 export function getProductTypes(params: {} | undefined) {
  return http.post(`${SSB}/productFault/queryCatalog`,params);
}
/**
 * 故障停机原因列表
 * 
 */
 export function getFailureReasons() {
  return http.get(`${SSB}/productFault/causeOfFailure`);
}

/**
 * 产品故障-故障数量
 * 
 */
 export function getFailureNums(params: {} | undefined) {
  return http.post(`${SSB}/productFault/faultNum`,params);
}


/**
 * 通过oem产品类型列表
 * 
 */
 export function getProductTypesByOems(params: {} | undefined) {
  return http.post(`${SSB}/mtbtReport/queryCatalogByOems`,params);
}

/**
 * 工时类别列表
 * 
 */
 export function getTaskTypes(params: {} | undefined) {
  return http.post(`${SSB}/serviceType/getWorkTypes`,params);
}

/**
 * 工单类型列表
 * 
 */
 export function getWorkOrderList(params: {} | undefined) {
  return http.get(`${SSB}/serviceType/getWorkOrderTypes`,params);
}


/**
 * 计划编号列表
 * 
 */
 export function getPlanNoList(params: {} | undefined) {
  return http.post(`${SSB}/coststatistics/costStatisticsQueryPlanNumber`,params);
}

/**
 * 工单编号列表
 * 
 */
 export function getTaskNoList(params: {} | undefined) {
  return http.post(`${SSB}/coststatistics/costStatisticsQueryTaskNo`,params);
}


/**
 * 费用统计报表部门搜索
 * 
 */
 export function getTagListByCost(params: {} | undefined) {
  return http.post(`${SSB}/coststatistics/costStatisticsQueryTag`,params);
}

/**
 * @des 出工率获取报表数据
 * @param params 
 * @returns 
 */
export function workHoursReportData(params:any){
	return http.post(`${SSB}/workHours/workHoursReportData`, params)
}

/**
 * @des 出工率导出报表数据
 * @param params 
 * @returns 
 */
export function workHoursReportExport(...arg:any){
	return http.post(`${SSB}/workHours/workHoursReportExport`, ...arg)
}

/**
 * @des 出工率获取oem列表
 * @param params 
 * @returns 
 */
export function getCustomerOEMDatabase(params:any){
	return http.get(`${SSB}/staff/calendar/getCustomerOEMDatabase`, params)
}

/**
 * @des 获取客户列表
 * @param params 
 * @returns 
 */
export function getOldCustomerList(params:any = {}){
  // 国际化时间改造 增加时间戳参数
  objectDateToTimestamp(params, [
    'createTimeStart',
    'createTimeEnd',
    'updateTimeStart',
    'updateTimeEnd',
  ])
  return http.post('/customer/list', params)
}

/**
 * @des 出工率获取部门
 * @param params 
 * @returns 
 */
export function getWorkHoursTagTree(params:any){
	return http.get(`${SSB}/workHours/tag/tree`, params)
}

/**
 * @des 出工率获取人员
 * @param params 
 * @returns 
 */
export function getWorkHoursTagUserList(params:any){
	return http.post(`${SSB}/workHours/tagUserList`, params)
}

/**
 * @des 报表获取搜索所需条件
 */
 export function getAllSelectDataList(params:any){
	return http.get(`${SSB}/productFault/getRequestParam`, params)
}






